package top.melody.ecommerce.webapps.www.weblogic;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import top.melody.ecommerce.platform.EcommerceException;
import top.melody.ecommerce.platform.api.domain.basedata.Region;
import top.melody.ecommerce.platform.api.service.BasedataService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: blentle
 * @group: rd
 * @createdate: 2016/12/3 10:42
 * @mail: blentle.huan.ren@gmail.com
 * @description:
 * @since:1.0
 */
@Service
public class BasedataWeblogic {

    private static final Logger logger = LoggerFactory.getLogger(BasedataWeblogic.class);
    @Resource
    private BasedataService basedataService;

    public List<Region> loadRegionListFromCache(int parentId) throws EcommerceException {
        //todo:load from cache
        Region queryEntity = new Region();
        queryEntity.setParentId(parentId);
        return basedataService.queryRegionListByPage(queryEntity,null).getRows();
    }
}
